package com.gao.autowired.nullwire;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author GaoXi
 * @date 2022/2/24 20:01
 */
@Component
public class RequireFalseDemo {
    private String name;
/*
    对构造方法没有用
    @Autowired(required = false)
    public RequireFalseDemo(String name) {
        this.name = name;
    }*/

    @Autowired(required = false)
    public void setName(String name) {
        this.name = name;
    }
}
